-
Notifications
You must be signed in to change notification settings - Fork 1k
Attempt to simplify the token cache providers #172
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
DO NOT MERGE Ideally we'd want the implementation of the token cache providers to be simplified. However this is not yet possible because the MSAL Abstract token cache provider contains a boolean telling if the token cache is an app or user token cache (so that the key can be computed). Ideally we'd want the ITokenCache to tell the application if it's an app token cache or a user token cache.
…member named IsApplicationTokenCache, brought by AzureAD/microsoft-authentication-library-for-dotnet#1448 cc: @bgavrilMS @jennyf19
@@ -57,6 +57,6 @@ | |||
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="2.2.0" /> | |||
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="2.2.0" /> | |||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="2.2.0" /> | |||
<PackageReference Include="Microsoft.Identity.Client" Version="4.3.1" /> | |||
<PackageReference Include="Microsoft.Identity.Client" Version="4.5.1-internal20191022.1isappcache" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Experimental. Contains PR AzureAD/microsoft-authentication-library-for-dotnet#1448, which not yet merged
cc: @bgavrilMS @jennyf19 @henrik-me @kalyankrishna1 @TiagoBrenck : if you want the MSAL.NET bits that work for this PR, see the artifacts of this build |
@@ -111,13 +102,29 @@ protected virtual Task OnBeforeWriteAsync(TokenCacheNotificationArgs args) | |||
|
|||
public async Task ClearAsync() | |||
{ | |||
await RemoveKeyAsync(CacheKey).ConfigureAwait(false); | |||
// This is here a user token cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is here a user token cache [](start = 15, length = 31)
nit. "This is a user token cache"
@@ -22,37 +20,6 @@ public static class SqlTokenCacheProviderExtension | |||
public static IServiceCollection AddSqlTokenCaches( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Can this be singular? All the others are singular (i think)...ex AddSqlTokenCache
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DO NOT MERGE yet (until Expose IsApplicationTokenCache #1448) is released in MSAL.NET
Ideally we'd want the implementation of the token cache
providers to be simplified. This is not yet possible because the MSAL Abstract token cache provider contained a boolean telling if the token cache is an app or user token cache (so that the key
can be computed).
Now the TokenCacheEventArgs bring this boolean.
This PR simplifies the code a lot.